<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票系统 - 登录</title>
    <!-- 引入Layui CSS -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/layui/2.8.17/css/layui.min.css">
    <!-- 引入Font Awesome -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <style>
        /* 自定义样式 */
        body {
            background-color: #f8f9fa;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            padding: 20px;
            box-sizing: border-box;
        }

        .login-container {
            background-color: #ffffff;
            border-radius: 10px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
            padding: 40px;
            width: 100%;
            max-width: 400px;
            transition: all 0.3s ease;
        }

        .login-container:hover {
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
        }

        .login-header {
            text-align: center;
            margin-bottom: 30px;
        }

        .login-header h2 {
            color: #333;
            margin-bottom: 10px;
        }

        .login-header p {
            color: #666;
            font-size: 14px;
        }

        .layui-form-item {
            margin-bottom: 20px;
        }

        .layui-input {
            height: 44px;
            border-radius: 5px;
            padding-left: 40px;
            border-color: #e6e6e6;
        }

        .layui-input:focus {
            border-color: #1E9FFF !important;
            box-shadow: 0 0 0 2px rgba(30, 159, 255, 0.2);
        }

        .input-icon {
            position: absolute;
            left: 10px;
            top: 12px;
            color: #999;
            font-size: 18px;
        }

        .layui-btn {
            height: 44px;
            border-radius: 5px;
            background-color: #1E9FFF;
            font-size: 16px;
        }

        .layui-btn:hover {
            background-color: #0D8BD9;
        }

        .login-footer {
            margin-top: 20px;
            text-align: center;
            font-size: 14px;
        }

        .login-footer a {
            color: #1E9FFF;
        }

        .login-footer a:hover {
            text-decoration: underline;
        }

        /* 响应式调整 */
        @media (max-width: 480px) {
            .login-container {
                padding: 30px 20px;
            }
        }
    </style>
</head>
<body>
<div class="login-container">
    <div class="login-header">
        <h2><i class="fa fa-bar-chart" aria-hidden="true"></i> 投票系统</h2>
        <p>请登录以继续</p>
    </div>

    <form class="layui-form" action="${pageContext.request.contextPath}/login" method="post">
        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="input-icon">
                    <i class="fa fa-user" aria-hidden="true"></i>
                </div>
                <input type="text" name="email" required lay-verify="required" placeholder="用户名"
                       autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-wrap">
                <div class="input-icon">
                    <i class="fa fa-lock" aria-hidden="true"></i>
                </div>
                <input type="password" name="password" required lay-verify="required" placeholder="密码"
                       autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="login">
                <i class="fa fa-sign-in" aria-hidden="true"></i> 登录
            </button>
        </div>
    </form>

    <p style="color: red">${loginMessage}</p>

    <div class="login-footer">
        <p>还没有账号？ <a href="${pageContext.request.contextPath}/views/register.jsp">立即注册</a></p>
        <p class="layui-hide-xs">忘记密码？ <a href="${pageContext.request.contextPath}/views/forgotPassword.jsp">找回密码</a></p>
    </div>
</div>
</body>
</html>


